import $axios from "./axios"
import $mockAxios from "./mockAxios"

export const reqCategoryList = ()=>$axios.get("/api/product/getBaseCategoryList")

export const reqSliceList = ()=>$mockAxios.get("/slice")

export const reqFloorList = ()=>$mockAxios.get("/floor")

export const reqGoodsList = (params) => $axios.post("/api/list",params)


export const reqGoodsDetail = (id) => $axios.get(`/api/item/${id}`)

export const ReqGetAddToCart = (skuId,skuNum) => $axios.post(`/api/cart/addToCart/${skuId}/${skuNum}`)

export const ReqGetCartList = (skuId,skuNum) => $axios.get(`/api/cart/cartList`)


export const ReqGetCheckCart = (skuID,isChecked) => $axios.get(`/api/cart/checkCart/${skuID}/${isChecked}`)

export const ReqGetCheckCartAll = (skuIdList,isChecked) => $axios.post(`/api/cart/batchCheckCart/${isChecked}`,skuIdList)


export const ReqDeleteOneGoods = (skuId) => $axios.delete(`/api/cart/deleteCart/${skuId}`)

export const ReqBatchDeleteCart = (skuIdList) => $axios.post(`/api/cart/batchDeleteCart`,skuIdList)

export const ReqGetRegister = (params) => $axios.post(`/api/user/passport/register`,params)

export const ReqPassport = (phone) => $axios.get(`/api/user/passport/sendCode/${phone}`)

export const ReqLogin = (params) => $axios.post(`/api/user/passport/login`,params)

export const ReqGetUserInfo = () => $axios.get(`/api/user/passport/auth/getUserInfo`)

export const ReqGetUserAddress = () => $mockAxios.get(`/api/user/userAddress/auth/findUserAddressList`)

export const ReqPassportLogout = () => $axios.get(`/api/user/passport/logout`)

export const ReqTrade = () => $axios.get(`/api/order/auth/trade`)

export const ReqSubmitOrder = (tradeNo,params) => $axios.post(`/api/order/auth/submitOrder?tradeNo=${tradeNo}`,params)

export const ReqCreateNative = (orderId) => $axios.get(`/api/payment/weixin/createNative/${orderId}`)































